import check from '@dfeidao/atom-nodejs/authorization/check-right';
import { IFeidaoAiNodejsPage } from '@dfeidao/atom-nodejs/interfaces';
import whoami from '@dfeidao/atom-nodejs/msg/whoami';
import redirect from '@dfeidao/atom-nodejs/server/redirect';
export default async function na001(fd: IFeidaoAiNodejsPage) {
	try {
		const user = await whoami(fd.data.actionid, fd.data.sessionid);
		const url = await check(fd, user.productid, '3', './login.html');
		if (url.redirect) {
			return redirect(url.redirect);
		}
	} catch (error) {
		return redirect('login.html');
	}
}
